package com.spring.advice;


import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;


/**
 * 环绕增强
 */
public class GreetingInterceptor implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        Object[] objects = methodInvocation.getArguments();//mub目标方法入参
        System.out.println("目标方法前执行。。。。。。" + objects[0]);
        methodInvocation.proceed();//反射机制调用目标方法
        System.out.println("目标方法后执行。。。。。。" + objects[0]);

        return null;
    }
}
